import { Controller, Get, Post } from '@nestjs/common';
import { SchedulerRegistry } from '@nestjs/schedule';
import { ApiOperation, ApiTags } from '@nestjs/swagger';
import { TaskService } from './task.service';

@ApiTags('定时任务')
@Controller('task')
export class TaskController {
  constructor(private readonly TaskService: TaskService) {}
  @Get('/TaskSatrt')
  @ApiOperation({ summary: '定时任务开启', description: '开启一个定时任务' })
  TaskStart() {
    return this.TaskService.TaskTest();
  }

  @Get('/TaskStop')
  @ApiOperation({ summary: '定时任务关闭' })
  TaskStop() {
    return this.TaskService.TaskTestStop();
  }
}
